<?php

/**
 * 通用后台管理员权限菜单
 * 说明：权限菜单采用四级结构，即 应用(app) - 模块(module) - 控制器(菜单controle) - 操作(接口和视图action)
 */
$data = [
    ['title' => '运营数据', 'children' => [
        ['title' => '运营概览', 'link' => 'index/main', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '运营日志', 'link' => 'index/logs', 'children' => [
            ['title' => '显示资源'], ['title' => '删除资源']
        ]]
    ]],
    ['title' => '商品模块管理', 'children' => [
        ['title' => '商品管理', 'link' => 'ec/goods/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '类别管理', 'link' => 'ec/categories/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '品牌管理', 'link' => 'ec/brands/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '规格管理', 'link' => 'ec/specifications/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '属性管理', 'link' => 'ec/attributes/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '标签管理', 'link' => 'ec/tags/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '商品促销推广管理', 'link' => 'ec/advertisings/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '商品评论管理', 'link' => 'ec/comments/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '优惠券管理', 'link' => 'ec/coupons/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '优惠券领取管理', 'link' => 'ec/coupons-received/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
    ]],
    ['title' => '订单模块管理', 'children' => [
        ['title' => '订单管理', 'link' => 'ec/orders/index', 'children' => [
            ['title' => '显示资源'],
            ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '订单操作日志管理', 'link' => 'ec/order-logs/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '订单退货管理', 'link' => 'ec/order-returns/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '物流公司管理', 'link' => 'ec/logistics-companies/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '运费模板管理', 'link' => 'ec/postages/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
    ]],
    ['title' => '用户管理', 'children' => [
        ['title' => '用户管理', 'link' => 'usr/users/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '用户等级', 'link' => 'usr/levels/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '用户地址', 'link' => 'usr/addresses/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '用户日志', 'link' => 'usr/logs/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
    ]],
    ['title' => '分销管理', 'children' => [
        ['title' => '推广员管理', 'link' => 'usr/promoters/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '分销等级管理', 'link' => 'usr/promoter_levels/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '推广奖励', 'link' => 'usr/promoter_rewards/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
    ]],
    ['title' => '权限管理', 'children' => [
        ['title' => '管理员管理', 'link' => 'esxauth/admins/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '分组管理', 'link' => 'esxauth/groups/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '规则管理', 'link' => 'esxauth/rules/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '管理员日志', 'link' => 'esxauth/logs/index', 'children' => [
            ['title' => '显示资源'], ['title' => '删除资源']
        ]]
    ]],
    ['title' => '系统管理', 'children' => [
        ['title' => '配置管理', 'link' => 'esxsys/configs/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '配置分组管理', 'link' => 'esxsys/config-groups/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '定时任务管理', 'link' => 'esxsys/crontabs/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '定时任务日志表 {"view":"rd"}管理', 'link' => 'esxsys/crontab-logs/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '邮箱验证码管理', 'link' => 'esxsys/email-captchas/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '短信验证码管理', 'link' => 'esxsys/sms-captchas/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
        ['title' => '用户反馈管理', 'link' => 'esxsys/feedbacks/index', 'children' => [
            ['title' => '显示资源'], ['title' => '创建资源'], ['title' => '编辑资源'], ['title' => '删除资源']
        ]],
    ]],
];

return [
    'table' => 'sw_auth_rules', 'text' => '通用后台管理员权限菜单', 'is_tree' => true, 'truncate' => true, 'data' => $data, 'append' => ['created_at' => time(), 'updated_at' => time()],
    // 动态更新权限组的规则字段的值
    'update_sql' => "update sw_auth_groups set rule_ids='__ids__' where group_name='admin';"
];
